package com.xhh.reapply.controller.v1;

import com.xhh.model.common.dtos.ResponseResult;
import com.xhh.model.reapply.dtos.AddChoiceDto;
import com.xhh.model.reapply.dtos.FiltrateStudentDto;
import com.xhh.model.reapply.dtos.UpdateChoiceDto;
import com.xhh.reapply.service.ReapplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@Api(tags = "调剂志愿管理接口")
@RestController
@RequestMapping("/reapply")
@RequiredArgsConstructor
public class ReapplyController {

    private final ReapplyService reapplyService;

    @ApiOperation("填报调剂志愿")
    @PostMapping("addChoice")
    public ResponseResult addChoice(@RequestBody AddChoiceDto dto){
        return reapplyService.addChoice(dto);
    }

    @ApiOperation("修改调剂志愿")
    @PutMapping("updateChoice")
    public ResponseResult updateChoice(@RequestBody UpdateChoiceDto dto){
        return reapplyService.updateChoice(dto);
    }

    @ApiOperation("查看调剂志愿")
    @GetMapping("get/{stuId}")
    public ResponseResult getChoice(@PathVariable("stuId") Long stuId){
        return reapplyService.getChoice(stuId);
    }

}
